<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>会员中心</h1>
    <div class="xx"></div>
    <script>
        // 当前时间>存的时间  就过期
        let localUname = new Date().getTime()>localStorage.getItem("expires")?null:localStorage.getItem("uname")
        let uname = localUname || sessionStorage.getItem("uname")
        if (uname)
        {
            document.querySelector(".xx").innerHTML = `<h3>${uname}</h3><a href="./logout.html">注销</a>`
        }else{
            document.querySelector(".xx").innerHTML = `<a href="./login.html">登录</a>`
        }
    </script>
</body>
</html>